package com.hades.xq.miaoshao.error;

public enum EmBusinessError implements CommonError {

    //100000开头为通用参数
    PARAMETER_VALIDATION_ERROR(100001, "参数不合法"),
    UNKNOW_ERROR(100002, "未知错误"),
    //20000开头为用户信息相关错误定义
    USER_NOT_EXIST(200001, "用户不存在"),
    USER_UNINPUT_TELPHONE(200002, "请输入用手机号码"),
    USER_LOGIN_FIAL(200003, "用户名或密码不正确"),
    USER_NOT_LOGIN(200004, "您还未登录，请您先登录"),
    //300000开头为交易型错误
    STOCK_NOT_ENOUGH(300001, "库存不足");


    private int errorCode;

    private String errorMsg;

    private EmBusinessError(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    @Override
    public int getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrirMsg() {
        return this.errorMsg;
    }

    @Override
    public CommonError setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }
}